package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商退换货类型枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum ReturnTypeEnum {

    RETURN(1, "退货"),
    EXCHANGE(2, "换货"),
    REFUND_ONLY(3, "仅退款"),
    ;

    /**
     * 类型值
     */
    private final Integer type;
    
    /**
     * 类型名称
     */
    private final String name;

    public static ReturnTypeEnum getByType(Integer type) {
        for (ReturnTypeEnum value : values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

}
